let data = [{
    "id": "1",
    "uid": "37573783",
    "username": "360fans3066324111",
    "num": "0",
    "prizeid": "0",
    "sys_status": "2",
    "smallpic": "https://p0.ssl.qhmsg.com/dmfd/400_300_100/t01d7c15053a5edf211.jpg",
    "pic": [
      "http://p0.qhmsg.com/t01d7c15053a5edf211.jpg",
      "http://p0.qhmsg.com/t01461bc8a779ac55db.jpg",
      "http://p0.qhmsg.com/t01255b276d1b3ce9a9.jpg"
    ]
  },
  {
    "id": "2",
    "uid": "34429533",
    "username": "俊俊小爷",
    "num": "0",
    "prizeid": "0",
    "sys_status": "2",
    "smallpic": "https://p0.ssl.qhmsg.com/dmfd/400_300_100/t0155cb8ddeaf547627.jpg",
    "pic": [
      "http://p0.qhmsg.com/t0155cb8ddeaf547627.jpg",
      "http://p0.qhmsg.com/t01000ee6651fdb6512.jpg",
      "http://p0.qhmsg.com/t011262d8bf5cc1e692.jpg",
      "http://p0.qhmsg.com/t01e8a71dd7448e0154.jpg",
      "http://p0.qhmsg.com/t01ba23128796a5cf3a.jpg",
      "http://p0.qhmsg.com/t01e86e42cf594c525b.jpg",
      "http://p0.qhmsg.com/t0117726dc3bac9fce2.jpg",
      "http://p0.qhmsg.com/t0168b770c568306bac.jpg",
      "http://p0.qhmsg.com/t01a0f96fb27e25ca0d.jpg"
    ]
  },
  {
    "id": "3",
    "uid": "38279079",
    "username": "360fans_YuQOoN",
    "num": "0",
    "prizeid": "0",
    "sys_status": "1",
    "smallpic": "https://p0.ssl.qhmsg.com/dmfd/400_300_100/t01df9a9477e286a6dd.jpg",
    "pic": [
      "http://p0.qhmsg.com/t01df9a9477e286a6dd.jpg",
      "http://p0.qhmsg.com/t01a16d97a191870005.jpg",
      "http://p0.qhmsg.com/t01da0a5b1aaaedf43a.jpg",
      "http://p0.qhmsg.com/t0160b0daba7cde7cf5.jpg",
      "http://p0.qhmsg.com/t010bf480f7b5085ee0.jpg"
    ]
  },
  {
    "id": "4",
    "uid": "85184",
    "username": "360fans130436045",
    "num": "0",
    "prizeid": "0",
    "sys_status": "0",
    "smallpic": "https://p0.ssl.qhmsg.com/dmfd/400_300_100/t0152a69253dac0ccbe.bmp",
    "pic": [
      "http://p0.qhmsg.com/t0152a69253dac0ccbe.bmp",
      "http://p0.qhmsg.com/t01f80530701e892e13.bmp"
    ]
  },
  {
    "id": "5",
    "uid": "30300856",
    "username": "Gillian",
    "num": "0",
    "prizeid": "0",
    "sys_status": "0",
    "smallpic": "https://p0.ssl.qhmsg.com/dmfd/400_300_100/t013e10f89763755f14.jpg",
    "pic": [
      "http://p0.qhmsg.com/t013e10f89763755f14.jpg",
      "http://p0.qhmsg.com/t0153ae318c33b07c59.jpg",
      "http://p0.qhmsg.com/t01a2711848cf3d3d22.jpg"
    ]
  },
  {
    "id": "6",
    "uid": "35513570",
    "username": "360fans743960423",
    "num": "0",
    "prizeid": "0",
    "sys_status": "2",
    "smallpic": "https://p0.ssl.qhmsg.com/dmfd/400_300_100/t01d996781d976ccf8c.jpg",
    "pic": [
      "http://p0.qhmsg.com/t01d996781d976ccf8c.jpg",
      "http://p0.qhmsg.com/t01e9e68025ff382ab5.jpg",
      "http://p0.qhmsg.com/t01a934edb811d16fd6.jpg",
      "http://p0.qhmsg.com/t0120e7ab518953bc24.jpg",
      "http://p0.qhmsg.com/t019ee7b07c2fcd87ca.jpg"
    ]
  },
  {
    "id": "7",
    "uid": "30181751",
    "username": "mclg",
    "num": "0",
    "prizeid": "0",
    "sys_status": "2",
    "smallpic": "https://p0.ssl.qhmsg.com/dmfd/400_300_100/t01c51be00db66ac198.jpg",
    "pic": [
      "http://p0.qhmsg.com/t01c51be00db66ac198.jpg",
      "http://p0.qhmsg.com/t01819552d39ef01d0e.jpg",
      "http://p0.qhmsg.com/t0170e2018b77a862dd.jpg",
      "http://p0.qhmsg.com/t01f1e27b15b06ff48d.jpg",
      "http://p0.qhmsg.com/t013539535f93e1f8c3.jpg",
      "http://p0.qhmsg.com/t01baaacd6ce88fe1d2.jpg",
      "http://p0.qhmsg.com/t01d271585cef9fcbe1.jpg",
      "http://p0.qhmsg.com/t015d0279cced5f30c1.jpg",
      "http://p0.qhmsg.com/t01fcc8c451908e143b.jpg",
      "http://p0.qhmsg.com/t015e04bc7dfcd844d9.jpg"
    ]
  },
  {
    "id": "8",
    "uid": "8009441",
    "username": "2000linglong.",
    "num": "0",
    "prizeid": "0",
    "sys_status": "2",
    "smallpic": "https://p0.ssl.qhmsg.com/dmfd/400_300_100/t01652e98b7598c9666.jpg",
    "pic": [
      "http://p0.qhmsg.com/t01652e98b7598c9666.jpg",
      "http://p0.qhmsg.com/t01958a56468b5c9b8c.jpg",
      "http://p0.qhmsg.com/t01a58a0fd2f427cd28.jpg",
      "http://p0.qhmsg.com/t012e8e65e13a0677e4.jpg"
    ]
  },
  {
    "id": "9",
    "uid": "30000402",
    "username": "骑鹤远行",
    "num": "0",
    "prizeid": "0",
    "sys_status": "2",
    "smallpic": "https://p0.ssl.qhmsg.com/dmfd/400_300_100/t0123e1a86d04a82a47.jpg",
    "pic": [
      "http://p0.qhmsg.com/t0123e1a86d04a82a47.jpg",
      "http://p0.qhmsg.com/t01d09606ec8b967b8b.jpg",
      "http://p0.qhmsg.com/t01216ef80a317a096f.jpg",
      "http://p0.qhmsg.com/t011f3a71efcfec1a5b.jpg",
      "http://p0.qhmsg.com/t01bf9a3cd6744f89ef.jpg",
      "http://p0.qhmsg.com/t01f177c9baf7888dfa.jpg"
    ]
  },
  {
    "id": "10",
    "uid": "36709112",
    "username": "o老头o",
    "num": "0",
    "prizeid": "0",
    "sys_status": "2",
    "smallpic": "https://p0.ssl.qhmsg.com/dmfd/400_300_100/t013732da07b49802c0.jpg",
    "pic": [
      "http://p0.qhmsg.com/t013732da07b49802c0.jpg",
      "http://p0.qhmsg.com/t017df7e3f6e3ef25fc.jpg",
      "http://p0.qhmsg.com/t0113c0cd409041a903.jpg",
      "http://p0.qhmsg.com/t01f7ab832ab5675030.jpg",
      "http://p0.qhmsg.com/t014541212f800d3377.jpg",
      "http://p0.qhmsg.com/t01caf2043b3b244334.jpg"
    ]
  },
  {
    "id": "11",
    "uid": "30033917",
    "username": "大布丁de猫",
    "num": "0",
    "prizeid": "0",
    "sys_status": "2",
    "smallpic": "https://p0.ssl.qhmsg.com/dmfd/400_300_100/t015216638f9c7552bb.jpg",
    "pic": [
      "http://p0.qhmsg.com/t015216638f9c7552bb.jpg"
    ]
  },
  {
    "id": "12",
    "uid": "34230586",
    "username": "360fans_飞龙在天",
    "num": "0",
    "prizeid": "0",
    "sys_status": "2",
    "smallpic": "https://p0.ssl.qhmsg.com/dmfd/400_300_100/t0139eafb763e5e6b08.jpg",
    "pic": [
      "http://p0.qhmsg.com/t0139eafb763e5e6b08.jpg",
      "http://p0.qhmsg.com/t01c3ab76f199601336.jpg",
      "http://p0.qhmsg.com/t01d41a93e5c48908f8.jpg"
    ]
  }
];

export default {
  'get /api/collections/:page': function(req, res, next) {
    var pages = parseInt(req.params.page);

    setTimeout(() => {
      res.json({
        result: data,
      })
    }, 1000)
  },
  'delete /api/cards/:id': function(req, res, next) {
    data = data.filter(v => v.id !== parseInt(req.params.id));
    console.log(req.params.id);
    console.log(data);
    setTimeout(() => {
      res.json({
        success: true,
      })
    }, 250)
  },
  'post /api/cards/add': function(req, res, next) {
    data = [...data, {
      ...req.body,
      id: data[data.length - 1].id + 1,
    }];

    res.json({
      success: true,
    });
  },
  'get /api/cards/:id/statistic': function(req, res, next) {
    res.json({
      result: [
        { genre: 'Sports', sold: 275 },
        { genre: 'Strategy', sold: 1150 },
        { genre: 'Action', sold: 120 },
        { genre: 'Shooter', sold: 350 },
        { genre: 'Other', sold: 150 },
      ]
    });
  },
}
